package com.hfzy.ihk.web.websocket.conf;

import com.hfzy.ihk.common.util.CommonUtils;
import com.hfzy.ihk.common.util.ResourceUtils;

import java.util.Map;

/**
 * Created by Administrator on 2018/7/31.
 *
 * 这种配置方式也是有好处：静态的属性，访问很方便（连注入都不需要）
 * @author wws
 */
public class PublicConfig {

    /**
     * public.params
     * public/params
     * \\public\\params
     * */
    public static Map<String, String> PUBLIC = ResourceUtils.getResource("public/params").getMap();

    public static String SYSTEM_ENV = System.getProperty("spring.profiles.active");
    public static String SYSTEM_CTI_NAME = System.getProperty("cloudcall.cti.name");
    public static String SHOW_NUM_DECREMENT = System.getProperty("showNum.decrement");
    public static String SYSTEM_ALI_YUN_RUN = System.getProperty("aliyun.run");

    /**动态设置服务器IP*/
    public static String SERVER_IP = CommonUtils.getServerIp();

    //是否忽略分行IP验证
    public static String CLOUDCALL_V2_TEST_IP_PRO =PUBLIC.get("cloudCall.v2.test.ip.pro");
    public static String CLOUDCALL_V2_TEST_IP_DEV =PUBLIC.get("cloudCall.v2.test.ip.dev");

    /** 是否开启外呼时的语音识别 */
    public static Boolean isOpenVoiceRecognise = PUBLIC.get("isOpenVoiceRecognise") != null ? Boolean.valueOf(PUBLIC.get("isOpenVoiceRecognise")) : false;

    public static Integer webSocketSameMachineThreshold = PUBLIC.get("webSocket.sameMachine.threshold") != null ? Integer.valueOf(PUBLIC.get("webSocket.sameMachine.threshold")) : 0;
}
